This adds the new bindings for signing and composefs use.
--- /dev/null
+// This file was generated by gir (https://github.com/gtk-rs/gir)
+// from gir-files
+// DO NOT EDIT
+
+use crate::{ffi};
+use glib::{prelude::*};
+#[cfg(feature = "v2016_5")]
+#[cfg_attr(docsrs, doc(cfg(feature = "v2016_5")))]
+use glib::{translate::*};
+
+glib::wrapper! {
+ #[doc(alias = "OstreeBlobReader")]
+ pub struct BlobReader(Interface<ffi::OstreeBlobReader, ffi::OstreeBlobReaderInterface>);
+
+ match fn {
+ type_ => || ffi::ostree_blob_reader_get_type(),
+ }
+}
+
+impl BlobReader {
+ pub const NONE: Option<&'static BlobReader> = None;
+
+}
+
+pub trait BlobReaderExt: IsA<BlobReader> + 'static {
+ #[cfg(feature = "v2016_5")]
+ #[cfg_attr(docsrs, doc(cfg(feature = "v2016_5")))]
+ #[doc(alias = "ostree_blob_reader_read_blob")]
+ fn read_blob(&self, cancellable: Option<&impl IsA<gio::Cancellable>>) -> Result<Option<glib::Bytes>, glib::Error> {
+ unsafe {
+ let mut error = std::ptr::null_mut();
+ let ret = ffi::ostree_blob_reader_read_blob(self.as_ref().to_glib_none().0, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error);
+ if error.is_null() { Ok(from_glib_full(ret)) } else { Err(from_glib_full(error)) }
+ }
+ }
+}
+
+impl<O: IsA<BlobReader>> BlobReaderExt for O {}
}
}
-//#[cfg(feature = "v2021_1")]
-//#[cfg_attr(docsrs, doc(cfg(feature = "v2021_1")))]
-//#[doc(alias = "ostree_commit_metadata_for_bootable")]
-//pub fn commit_metadata_for_bootable(root: &impl IsA<gio::File>, dict: /*Ignored*/&glib::VariantDict, cancellable: Option<&impl IsA<gio::Cancellable>>) -> Result<(), glib::Error> {
-// unsafe { TODO: call ffi:ostree_commit_metadata_for_bootable() }
-//}
+#[cfg(feature = "v2021_1")]
+#[cfg_attr(docsrs, doc(cfg(feature = "v2021_1")))]
+#[doc(alias = "ostree_commit_metadata_for_bootable")]
+pub fn commit_metadata_for_bootable(root: &impl IsA<gio::File>, dict: &glib::VariantDict, cancellable: Option<&impl IsA<gio::Cancellable>>) -> Result<(), glib::Error> {
+ unsafe {
+ let mut error = std::ptr::null_mut();
+ let is_ok = ffi::ostree_commit_metadata_for_bootable(root.as_ref().to_glib_none().0, dict.to_glib_none().0, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error);
+ debug_assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null());
+ if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) }
+ }
+}
#[doc(alias = "ostree_content_file_parse")]
pub fn content_file_parse(compressed: bool, content_path: &impl IsA<gio::File>, trusted: bool, cancellable: Option<&impl IsA<gio::Cancellable>>) -> Result<(gio::InputStream, gio::FileInfo, glib::Variant), glib::Error> {
mod async_progress;
pub use self::async_progress::AsyncProgress;
+mod blob_reader;
+pub use self::blob_reader::BlobReader;
+
mod bootconfig_parser;
pub use self::bootconfig_parser::BootconfigParser;
pub use self::constants::TREE_GVARIANT_STRING;
pub(crate) mod traits {
+ pub use super::blob_reader::BlobReaderExt;
pub use super::repo_finder::RepoFinderExt;
pub use super::sign::SignExt;
}
}
}
- //#[doc(alias = "ostree_repo_commit_add_composefs_metadata")]
- //pub fn commit_add_composefs_metadata(&self, format_version: u32, dict: /*Ignored*/&glib::VariantDict, repo_root: &RepoFile, cancellable: Option<&impl IsA<gio::Cancellable>>) -> Result<(), glib::Error> {
- // unsafe { TODO: call ffi:ostree_repo_commit_add_composefs_metadata() }
- //}
+ #[doc(alias = "ostree_repo_commit_add_composefs_metadata")]
+ pub fn commit_add_composefs_metadata(&self, format_version: u32, dict: &glib::VariantDict, repo_root: &RepoFile, cancellable: Option<&impl IsA<gio::Cancellable>>) -> Result<(), glib::Error> {
+ unsafe {
+ let mut error = std::ptr::null_mut();
+ let is_ok = ffi::ostree_repo_commit_add_composefs_metadata(self.to_glib_none().0, format_version, dict.to_glib_none().0, repo_root.to_glib_none().0, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error);
+ debug_assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null());
+ if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) }
+ }
+ }
#[doc(alias = "ostree_repo_commit_transaction")]
pub fn commit_transaction(&self, cancellable: Option<&impl IsA<gio::Cancellable>>) -> Result<RepoTransactionStats, glib::Error> {
#[cfg(feature = "v2020_2")]
#[cfg_attr(docsrs, doc(cfg(feature = "v2020_2")))]
use crate::{Repo};
+#[cfg(feature = "v2025_2")]
+#[cfg_attr(docsrs, doc(cfg(feature = "v2025_2")))]
+use crate::{BlobReader};
use glib::{prelude::*};
#[cfg(feature = "v2020_2")]
#[cfg_attr(docsrs, doc(cfg(feature = "v2020_2")))]
}
}
- //#[cfg(feature = "v2025_2")]
- //#[cfg_attr(docsrs, doc(cfg(feature = "v2025_2")))]
- //#[doc(alias = "ostree_sign_read_pk")]
- //fn read_pk(&self, stream: &impl IsA<gio::InputStream>) -> /*Ignored*/BlobReader {
- // unsafe { TODO: call ffi:ostree_sign_read_pk() }
- //}
+ #[cfg(feature = "v2025_2")]
+ #[cfg_attr(docsrs, doc(cfg(feature = "v2025_2")))]
+ #[doc(alias = "ostree_sign_read_pk")]
+ fn read_pk(&self, stream: &impl IsA<gio::InputStream>) -> BlobReader {
+ unsafe {
+ from_glib_full(ffi::ostree_sign_read_pk(self.as_ref().to_glib_none().0, stream.as_ref().to_glib_none().0))
+ }
+ }
- //#[cfg(feature = "v2025_2")]
- //#[cfg_attr(docsrs, doc(cfg(feature = "v2025_2")))]
- //#[doc(alias = "ostree_sign_read_sk")]
- //fn read_sk(&self, stream: &impl IsA<gio::InputStream>) -> /*Ignored*/BlobReader {
- // unsafe { TODO: call ffi:ostree_sign_read_sk() }
- //}
+ #[cfg(feature = "v2025_2")]
+ #[cfg_attr(docsrs, doc(cfg(feature = "v2025_2")))]
+ #[doc(alias = "ostree_sign_read_sk")]
+ fn read_sk(&self, stream: &impl IsA<gio::InputStream>) -> BlobReader {
+ unsafe {
+ from_glib_full(ffi::ostree_sign_read_sk(self.as_ref().to_glib_none().0, stream.as_ref().to_glib_none().0))
+ }
+ }
#[cfg(feature = "v2020_2")]
#[cfg_attr(docsrs, doc(cfg(feature = "v2020_2")))]
Generated by gir (https://github.com/gtk-rs/gir @ 19ccbbc9a3d1)
-from gir-files (@ ac81709f18d2)
+from gir-files (@ 9ff946fcca99)
Generated by gir (https://github.com/gtk-rs/gir @ 19ccbbc9a3d1)
-from gir-files (@ ac81709f18d2)
+from gir-files (@ 9ff946fcca99)
// OstreeBlobReader
//=========================================================================
pub fn ostree_blob_reader_get_type() -> GType;
+ #[cfg(feature = "v2016_5")]
+ #[cfg_attr(docsrs, doc(cfg(feature = "v2016_5")))]
pub fn ostree_blob_reader_read_blob(
self_: *mut OstreeBlobReader,
cancellable: *mut gio::GCancellable,